package hu;

import java.util.Scanner;

public class hu5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        System.out.println(Integer.parseInt(str.substring(2),16));

        System.out.println(Integer.toBinaryString(10));
    }
}
